<template>
	<div class="bgfff pad20">
		<el-form ref="form" label-width="100px">
			<el-form-item label="大屏配置">
				<el-radio-group v-model="params.gasOutlet" @change="updateEnterpriseInfo">
					<el-radio label="ONLINE_MONITOR">纯在线监测方案</el-radio>
					<el-radio label="ONLINE_MANUAL_MONITOR">在线和自行监测方案</el-radio>
				</el-radio-group>
			</el-form-item>
			<el-form-item label="企业简称" class="mt12">
				<el-input v-model="params.entShortName" placeholder="企业简称" style="width: 600px;"
					@change="updateEnterpriseInfo"></el-input>
			</el-form-item>

			<!-- <div class="font16">网页配置</div> -->
			<el-form-item label="首页配置">
				<div class="displayFlex mb10">
					<div style="padding: 30px 50px;background: #f5f5f5;width: 300px;" class="color333 mr20 bra8 textCenter">
						日常代办</div>
					<div style="padding: 30px 50px;background: #f5f5f5;width: 300px;" class="color333 bra8 textCenter">预警和工单
					</div>
				</div>

				<div class="displayFlex mb10">
					<div style="padding: 30px 50px;background: #f5f5f5;width: 300px;" class="color333 mr20 bra8 textCenter">
						<el-select placeholder="第一个模块" v-model="params.moduleOne" class="mr10" @change="updateEnterpriseInfo" clearable>
							<el-option v-for="item in dataList2" :label="item.label" :value="item.value">
								{{item.label}}
							</el-option>
						</el-select>
					</div>

					<div style="padding: 30px 50px;background: #f5f5f5;width: 300px;" class="color333 textCenter bra8">
						<el-select placeholder="第二个模块" v-model="params.moduleTwo" class="mr10" @change="updateEnterpriseInfo" clearable>
							<el-option v-for="item in dataList2" :label="item.label" :value="item.value">
								{{item.label}}
							</el-option>
						</el-select>
					</div>
				</div>

				<div class="displayFlex mb10">
					<div style="padding: 30px 50px;background: #f5f5f5;width: 300px;" class="color333 mr20 bra8 textCenter">
						<el-select placeholder="第三个模块" v-model="params.moduleThree" class="mr10"
							@change="updateEnterpriseInfo" clearable>
							<el-option v-for="item in dataList2" :label="item.label" :value="item.value">
								{{item.label}}
							</el-option>
						</el-select>
					</div>
					<div style="padding: 30px 50px;background: #f5f5f5;width: 300px;" class="color333 bra8 textCenter">
						<el-select placeholder="第四个模块" v-model="params.moduleFour" class="mr10"
							@change="updateEnterpriseInfo" clearable>
							<el-option v-for="item in dataList2" :label="item.label" :value="item.value">
								{{item.label}}
							</el-option>
						</el-select>
					</div>
				</div>


				<div class="displayFlex mb10">
					<div style="padding: 30px 50px;background: #f5f5f5;width: 300px;" class="color333 mr20 bra8 textCenter">
						<el-select placeholder="第五个模块" v-model="params.moduleFive" class="mr10"
							@change="updateEnterpriseInfo" clearable>
							<el-option v-for="item in dataList2" :label="item.label" :value="item.value">
								{{item.label}}
							</el-option>
						</el-select>
					</div>

					<div style="padding: 30px 50px;background: #f5f5f5;width: 300px;" class="color333 bra8 textCenter">
						<el-select placeholder="第六个模块" v-model="params.moduleSix" class="mr10" @change="updateEnterpriseInfo" clearable>
							<el-option v-for="item in dataList2" :label="item.label" :value="item.value">
								{{item.label}}
							</el-option>
						</el-select>
					</div>
				</div>
			</el-form-item>
			<!-- <el-form-item label="系统使用时间">
				<el-date-picker v-model="beginUseTime" type="date" placeholder="选择日期" @change="saveBeginUseTime" size="small"
					style="width: 150px;">
				</el-date-picker>
			</el-form-item> -->

			<!-- <el-form-item label="配置">
				<el-checkbox-group v-model="selectDocumentSettingList" @change="updateEnterpriseInfo">
					<el-checkbox :label="item.settingCode" v-for="item in documentSettingList">
						{{item.settingName}}
					</el-checkbox>
				</el-checkbox-group>
			</el-form-item>
			
			<el-form-item label="企业标识码">
				<div style="color: #999;">{{identityCode}}</div>
			</el-form-item> -->
		</el-form>
	</div>
</template>

<script>
	import {
		Session
	} from '@/utils/storage.js';
	let that
	export default {
		data() {
			return {
				params: {
					gasOutlet: ''
				},
				dataList1: [{
					label: '纯在线监测方案',
					value: 'ONLINE_MONITOR'
				}, {
					label: '在线和自行监测方案',
					value: 'ONLINE_MANUAL_MONITOR'
				}],
				dataList2: [{
					label: '危险废物',
					value: 'DANGER_WASTE'
				}, {
					label: '一般工业固体废物',
					value: 'COMMON_WASTE'
				}, {
					label: '废气',
					value: 'WASTE_GAS'
				}, {
					label: '废水',
					value: 'WASTE_WATER'
				},  {
					label: '土壤',
					value: 'SOIL'
				}, {
					label: '噪音',
					value: 'NOISE'
				}]
			}
		},
		created: function() {},
		mounted: function() {
			that = this
			//that.params.ticketId = that.$store.state.token

			// that.ajax({
			// 	url: '/document/getDocumentEntBaseInfo?ticketId=' +
			// 		that.params.ticketId,
			// 	contentType: 'application/json',
			// 	data: JSON.stringify(that.params),
			// 	success: function(result) {
			// 		if (result && result.data) {
			// 			if (result.data.identityCode) that.identityCode = result.data.identityCode
			// 		}
			// 	},
			// })

			that.getDocumentSettingsSelectInfo()
		},

		methods: {

			updateEnterpriseInfo() {
				that.ajax({
					url: '/bbep/page/config/save?ticketId=' + that.$store.state.token,
					data: JSON.stringify(that.params),
					contentType: 'application/json',
					dataType: 'json',
					success: function(result) {
						that.$message({
							showClose: true,
							message: '保存成功',
							type: 'success'
						});
						Session.set('setting', that.params)
					},

				})
			},

			getDocumentSettingsSelectInfo: function() {
				that.ajax({
					url: '/bbep/page/config/getConfig?ticketId=' + that.$store.state.token,
					data: JSON.stringify({}),
					contentType: 'application/json',
					dataType: 'json',
					success: function(result) {
						if (result.status == 1 && result.data) {
							that.params = result.data
							Session.set('setting', result.data)
							that.$store.dispatch("userInfos/setSetting", result.data);


						}
					}
				})
			},

			// saveBeginUseTime() {
			// 	that.ajax({
			// 		url: '/facilitatorConfig/saveFacilitatorConfig?ticketId=' +
			// 			that.params.ticketId,
			// 		contentType: 'application/json',
			// 		data: JSON.stringify({
			// 			beginUseTime: that.beginUseTime
			// 		}),
			// 		success: function(result) {
			// 			that.$message({
			// 				showClose: true,
			// 				message: '保存成功',
			// 				type: 'success'
			// 			});
			// 		},
			// 	})
			// },

			// createSystemDocumentEntSchedule() {
			// 	this.$confirm('是否生成待办?', '提示', {
			// 		confirmButtonText: '确定',
			// 		cancelButtonText: '取消',
			// 		type: 'warning'
			// 	}).then(() => {
			// 		that.ajax({
			// 			url: '/documentEntPlan/createSystemPlan?ticketId=' + that.params
			// 				.ticketId,
			// 			data: {},
			// 			contentType: 'application/x-www-form-urlencoded',
			// 			success: function(result) {
			// 				if (result.status && result.data) {
			// 					that.$message({
			// 						showClose: true,
			// 						message: '生成成功',
			// 						type: 'success'
			// 					});
			// 				} else {
			// 					that.$message({
			// 						showClose: true,
			// 						message: result.infoList[0],
			// 						type: 'error'
			// 					});
			// 				}
			// 			}
			// 		})
			// 	})
			// },

		}
	}
</script>

<style scoped>
</style>